<?php
include("conn/conn.php");
header('Content-type:text/json'); 
$all=array();
$city=$_GET['id'];
$all['code']=200;
$all['msg']='提交成功';
	$lpid=$_POST['lpid'];
	$pid=$_POST['pid'];
	$uname=$_POST['name'];
	$usex=$_POST['usex'];
	$utel=$_POST['mobile'];
	$utitle=$_POST['utitle'];
	$ucontent=$_POST['ucontent'];
	$intention_city=$_POST['intention_city'];
	$intention_housetype=$_POST['intention_housetype'];
	$intention_lp=$_POST['intention_lp'];
	$intention_price=$_POST['intention_price'];
	$ly=$_POST['ly'];
	$addtime=date('Y-m-d H:i:s');
	
	if($intention_city<>""){
		$ucontent.='　意向区域:'.$intention_city;
		}
	if($intention_housetype<>""){
		$ucontent.='　意向户型:'.$intention_housetype;
		}
	if($intention_lp<>""){
		$ucontent.='　意向楼盘:'.$intention_lp;
		}
	if($intention_price<>""){
		$ucontent.='　意向价格:'.$intention_price;
		}
	if($ly<>""){
		$ucontent.='　提交来源:'.$ly;
		}
		
		$mysql->query("insert into `web_book`(
		`pid`,
		`lpid`,
		`uname`,
		`usex`,
		`utel`,
		`utitle`,
		`ucontent`,
		`addtime`
		) values (
		'{$pid}',
		'{$lpid}',
		'{$uname}',
		'{$usex}',
		'{$utel}',
		'{$utitle}',
		'{$ucontent}',
		'{$addtime}'
		)");
		$ids=mysql_insert_id();
		if($ids!==0){
$all['status']=1;
			echo json_encode($all);
			exit();
			}else{
			$all['code']=300;
			$all['msg']='提交失败';
			echo json_encode($all);
			exit();
			}
		echo json_encode($all);
		exit();
